package com.ruoyi.system.task;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * 处理文件导入逻辑
 *
 * @author xuwei
 */
@Slf4j
public class ByExportThreadTask implements Runnable {

    private ByExportProcessorWrapper byExportProcessorWrapper;

    /**
     */
    public ByExportThreadTask(String userId,AtomicInteger allCount, AtomicInteger failCount, AtomicInteger successCount) {
        byExportProcessorWrapper = new ByExportProcessorWrapper();
        byExportProcessorWrapper.init(userId, allCount, failCount, successCount);
    }

    public void setKeyword(String keyword) {
        byExportProcessorWrapper.setKeyword(keyword);
    }
    public void setA101(String a101) {
        byExportProcessorWrapper.setA101(a101);
    }
    public void setA200(String a200) {
        byExportProcessorWrapper.setA200(a200);
    }
    public void setStandardType(String standardType) {
        byExportProcessorWrapper.setStandardType(standardType);
    }

    public void setTaskId(int taskid) {
        byExportProcessorWrapper.setTaskId(taskid);
    }

    @Override
    public void run() {
        // no matter what happened, can't effected the main process.
        try {
            byExportProcessorWrapper.execute();
        } catch (Exception e) {
            log.error(e.getMessage(), e);
        }
    }

}
